/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements.  See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License.  You may obtain a copy of the License at
*
*     http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package javax.servlet.http;


/**
 * HttpSession的生命周期过程中，HttpSession的每次变动都可以进行监控，Servlet API提供了丰富的针对HttpSession的监听器：
 *
 * · HttpSessionListener：当HttpSession创建或销毁时触发相应的事件。
 *
 * · HttpSessionActivationListener：当HttpSession钝化（序列化）或激活（反序列化）是触发相应的事件。
 *
 * · HttpSessionAttributeListener：当在HttpSession中添加、移除或更改属性值时会触发相应的事件。
 *
 * · HttpSessionBindingListener：实现HttpSessionBindingListener接口的对象被绑定到HttpSession时触发valueBound事件,解除绑定时触发valueUnbound事件。
 * 这个监听和HttpSessionAttributeListener的区别还是较大的，HttpSessionAttributeListener针对的是所有可绑定到HttpSesesion中的对象。
 * HttpSessionBindingListener则是要求对象必须实现了HttpSessionBindingListener接口。
 *
 * HttpSessionEvent是HttpSessionListener和HttpSessionActivationListener的事件类，其中包含了被创建或被销毁的HttpSession对象和被钝化（序列化）或激活（反序列化）的HttpSession对象
 *
 * 它表示web应用程序中会话更改的事件通知的类.
 *
 * This is the class representing event notifications for
 * changes to sessions within a web application.
 * @since	v 2.3
 */
public class HttpSessionEvent extends java.util.EventObject {
	/** Construct a session event from the given source.*/
	 public HttpSessionEvent(HttpSession source) {
		super(source);
}
	/**
	 * 获取事件里的HttpSession.
	 *
	 * Return the session that changed.
	 */
    public HttpSession getSession () { 
	return (HttpSession) super.getSource();
    }
}

